package com.sh.data.engine.domain.normalization.standard.model.enums;

import java.util.Objects;

/**
 * @author boyue.wjl
 */
public enum YesOrNoEnum {
    YES(1, "是"),
    NO(0, "否"),
    ;

    private Integer val;
    private String des;

    private YesOrNoEnum(Integer val, String des) {
        this.val = val;
        this.des = des;
    }

    public static YesOrNoEnum valueOfDes(String des) {
        for (YesOrNoEnum yesOrNoEnum : values()) {
            if (Objects.equals(yesOrNoEnum.getDes(), des)) {
                return yesOrNoEnum;
            }
        }
        return null;
    }

    public Integer getVal() {
        return val;
    }

    public String getDes() {
        return des;
    }
}
